﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ChinaGS.Lian.ModuleRemoting;

public partial class pay_express_confirm_utilities_nc : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String cusNo = this.Request["utilities_nc_num"];
            UtilitiesNoCardPackage uncp = RemotingClass.utilitiesNoCardBillCheck(cusNo);

            //测试使用
            /*UtilitiesNoCardPackage uncp = new UtilitiesNoCardPackage();
            uncp.Status = true;
            uncp.SerialNo = "1234567890";
            uncp.Message = "success";
            uncp.StatusNo = "00";

            uncp.CusNo = cusNo;
            uncp.CusName = "Denveryee";
            uncp.CusAddress = "qd";
            uncp.SumMoney = 1000;

            NocardPeriod np1 = new NocardPeriod();
            np1.Period = "one";
            np1.RecviMoney = 900;
            np1.DefCode = "12345678901234567890";

            NocardPeriod np2 = new NocardPeriod();
            np2.Period = "two";
            np2.RecviMoney = 100;
            np2.DefCode = "12345678901234567890";

            NocardPeriod[] nps = new NocardPeriod[2] { np1, np2 };
            uncp.Periods = nps;*/

            DataList1.DataSource = uncp.Periods;
            DataList1.DataBind();

            if (uncp.Status)
            {
                if (!uncp.StatusNo.Equals("00"))
                {
                    //测试使用
                    this.LabMessage.Text = uncp.Message;
                    //调整内容正式时使用
                    //this.LabMessage.Text = RemotingClass.showErrorMessage(uncp.StatusNo);                        
                    PanBill.Visible = false;
                }
                else
                {
                    LabMessage.Text = "尊敬的" + uncp.CusName + "用户，您的账单信息如下，网上只能缴纳最近一次的费用，请确认：";

                    LabSumMoney.Text = uncp.SumMoney.ToString();
                    LabCusAddress.Text = uncp.CusAddress;
                    LabCusName.Text = uncp.CusName;
                    LabCusNo.Text = uncp.CusNo;

                    HidSumMoney.Value = uncp.SumMoney.ToString();
                    HidCusAddress.Value = uncp.CusAddress;
                    HidCusName.Value = uncp.CusName;
                    HidCusNo.Value = uncp.CusNo;
                    HidDefCode.Value = uncp.Periods[0].DefCode;

                }
            }
            else
            {
                this.LabMessage.Text = "本次操作失败，错误信息是：" + uncp.Message + "请稍后重试！";
                PanBill.Visible = false;
                //显示查询失败
            }

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("fill_utilities_nc.aspx?"
                                            + "HidSumMoney=" + HidSumMoney.Value
                                            + "&HidCusAddress=" + HidCusAddress.Value
                                            + "&HidCusName=" + HidCusName.Value
                                            + "&HidCusNo=" + HidCusNo.Value
                                            + "&HidDefCode=" + HidDefCode.Value);
    }
}
